<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="format-detection" content="telephone=no"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><link rel="icon" href="/images/icons/favicon-16x16.png?v=2.8.0" type="image/png" sizes="16x16"><link rel="icon" href="/images/icons/favicon-32x32.png?v=2.8.0" type="image/png" sizes="32x32"><meta name="description" content="II 准备工作                             第2节 准备宿主系统">
<meta property="og:type" content="article">
<meta property="og:title" content="LFS-II-准备工作">
<meta property="og:url" content="http://hipposox.github.io/2023/01/12/LFS-II-%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="II 准备工作                             第2节 准备宿主系统">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2023-01-12T14:38:48.000Z">
<meta property="article:modified_time" content="2023-01-12T15:25:27.106Z">
<meta property="article:author" content="HippoSoX">
<meta property="article:tag" content="LFS">
<meta name="twitter:card" content="summary"><title>LFS-II-准备工作 | Hexo</title><link ref="canonical" href="http://hipposox.github.io/2023/01/12/LFS-II-%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C/"><link rel="dns-prefetch" href="https://cdn.jsdelivr.net"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.12.1/css/all.min.css" type="text/css"><link rel="stylesheet" href="/css/index.css?v=2.8.0"><link rel="stylesheet" href="css/custom.css"><script>var Stun = window.Stun || {};
var CONFIG = {
  root: '/',
  algolia: undefined,
  assistSearch: undefined,
  fontIcon: {"prompt":{"success":"fas fa-check-circle","info":"fas fa-arrow-circle-right","warning":"fas fa-exclamation-circle","error":"fas fa-times-circle"},"copyBtn":"fas fa-copy"},
  sidebar: {"offsetTop":"20px","tocMaxDepth":6},
  header: {"enable":true,"showOnPost":true,"scrollDownIcon":false},
  postWidget: {"endText":true},
  nightMode: {"enable":true},
  back2top: {"enable":true},
  codeblock: {"style":"default","highlight":"dark","wordWrap":false},
  reward: false,
  fancybox: false,
  zoomImage: {"gapAside":"20px"},
  galleryWaterfall: undefined,
  lazyload: true,
  pjax: undefined,
  externalLink: {"icon":{"enable":true,"name":"fas fa-external-link-alt"}},
  shortcuts: undefined,
  prompt: {"copyButton":"复制","copySuccess":"复制成功","copyError":"复制失败"},
  sourcePath: {"js":"js","css":"css","images":"images"},
};

window.CONFIG = CONFIG;</script><meta name="generator" content="Hexo 5.4.2"></head><body><div class="container" id="container"><header class="header" id="header"><div class="header-inner"><nav class="header-nav header-nav--fixed"><div class="header-nav-inner"><div class="header-nav-menubtn"><i class="fas fa-bars"></i></div><div class="header-nav-menu"><div class="header-nav-menu-item"><a class="header-nav-menu-item__link" href="/"><span class="header-nav-menu-item__icon"><i class="fas fa-home"></i></span><span class="header-nav-menu-item__text">首页</span></a></div><div class="header-nav-menu-item"><a class="header-nav-menu-item__link" href="/archives/"><span class="header-nav-menu-item__icon"><i class="fas fa-folder-open"></i></span><span class="header-nav-menu-item__text">归档</span></a></div><div class="header-nav-menu-item"><a class="header-nav-menu-item__link" href="/categories/"><span class="header-nav-menu-item__icon"><i class="fas fa-layer-group"></i></span><span class="header-nav-menu-item__text">分类</span></a></div><div class="header-nav-menu-item"><a class="header-nav-menu-item__link" href="/tags/"><span class="header-nav-menu-item__icon"><i class="fas fa-tags"></i></span><span class="header-nav-menu-item__text">标签</span></a></div></div><div class="header-nav-mode"><div class="mode"><div class="mode-track"><span class="mode-track-moon"></span><span class="mode-track-sun"></span></div><div class="mode-thumb"></div></div></div></div></nav><div class="header-banner"><div class="header-banner-info"><div class="header-banner-info__title">erocool</div><div class="header-banner-info__subtitle">You know what</div></div></div></div></header><main class="main" id="main"><div class="main-inner"><div class="content-wrap" id="content-wrap"><div class="content" id="content"><!-- Just used to judge whether it is an article page--><div id="is-post"></div><div class="post"><header class="post-header"><h1 class="post-title">LFS-II-准备工作</h1><div class="post-meta"><span class="post-meta-item post-meta-item--createtime"><span class="post-meta-item__icon"><i class="far fa-calendar-plus"></i></span><span class="post-meta-item__info">发表于</span><span class="post-meta-item__value">2023-01-12</span></span><span class="post-meta-item post-meta-item--updatetime"><span class="post-meta-item__icon"><i class="far fa-calendar-check"></i></span><span class="post-meta-item__info">更新于</span><span class="post-meta-item__value">2023-01-12</span></span></div></header><div class="post-body">
        <h1 id="ii-准备工作"   >
          <a href="#ii-准备工作" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#ii-准备工作"></a> II 准备工作</h1>
      

        <h2 id="第2节-准备宿主系统"   >
          <a href="#第2节-准备宿主系统" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#第2节-准备宿主系统"></a> 第2节 准备宿主系统</h2>
      
<span id="more"></span>

        <h3 id="换源"   >
          <a href="#换源" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#换源"></a> 换源</h3>
      
<p>/etc/apt/sources.list</p>
<figure class="highlight plaintext"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse</span><br><span class="line">deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse</span><br><span class="line"></span><br><span class="line">deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse</span><br><span class="line">deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse</span><br><span class="line"></span><br><span class="line">deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse</span><br><span class="line">deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse</span><br><span class="line"></span><br><span class="line">deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse</span><br><span class="line">deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse</span><br><span class="line"></span><br><span class="line">## Not recommended</span><br><span class="line"># deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse</span><br><span class="line"># deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse</span><br></pre></td></tr></table></div></figure>

        <h3 id="检查编译环境"   >
          <a href="#检查编译环境" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#检查编译环境"></a> 检查编译环境</h3>
      
<p><span class="exturl"><a class="exturl__link"   target="_blank" rel="noopener" href="http://version-check.sh" >version-check.sh</a><span class="exturl__icon"><i class="fas fa-external-link-alt"></i></span></span></p>
<figure class="highlight sh"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="comment"># Simple script to list version numbers of critical development tools</span></span><br><span class="line"><span class="built_in">export</span> LC_ALL=C</span><br><span class="line">bash --version | <span class="built_in">head</span> -n1 | <span class="built_in">cut</span> -d<span class="string">&quot; &quot;</span> -f2-4</span><br><span class="line">MYSH=$(<span class="built_in">readlink</span> -f /bin/sh)</span><br><span class="line"><span class="built_in">echo</span> <span class="string">&quot;/bin/sh -&gt; <span class="variable">$MYSH</span>&quot;</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">$MYSH</span> | grep -q bash || <span class="built_in">echo</span> <span class="string">&quot;ERROR: /bin/sh does not point to bash&quot;</span></span><br><span class="line"><span class="built_in">unset</span> MYSH</span><br><span class="line"><span class="built_in">echo</span> -n <span class="string">&quot;Binutils: &quot;</span>; ld --version | <span class="built_in">head</span> -n1 | <span class="built_in">cut</span> -d<span class="string">&quot; &quot;</span> -f3-</span><br><span class="line">bison --version | <span class="built_in">head</span> -n1</span><br><span class="line"><span class="keyword">if</span> [ -h /usr/bin/yacc ]; <span class="keyword">then</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">&quot;/usr/bin/yacc -&gt; `readlink -f /usr/bin/yacc`&quot;</span>;</span><br><span class="line"><span class="keyword">elif</span> [ -x /usr/bin/yacc ]; <span class="keyword">then</span></span><br><span class="line"> <span class="built_in">echo</span> yacc is `/usr/bin/yacc --version | <span class="built_in">head</span> -n1`</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">&quot;yacc not found&quot;</span> </span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line">bzip2 --version 2&gt;&amp;1 &lt; /dev/null | <span class="built_in">head</span> -n1 | <span class="built_in">cut</span> -d<span class="string">&quot; &quot;</span> -f1,6-</span><br><span class="line"><span class="built_in">echo</span> -n <span class="string">&quot;Coreutils: &quot;</span>; <span class="built_in">chown</span> --version | <span class="built_in">head</span> -n1 | <span class="built_in">cut</span> -d<span class="string">&quot;)&quot;</span> -f2</span><br><span class="line">diff --version | <span class="built_in">head</span> -n1</span><br><span class="line">find --version | <span class="built_in">head</span> -n1</span><br><span class="line">gawk --version | <span class="built_in">head</span> -n1</span><br><span class="line"><span class="keyword">if</span> [ -h /usr/bin/awk ]; <span class="keyword">then</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">&quot;/usr/bin/awk -&gt; `readlink -f /usr/bin/awk`&quot;</span>;</span><br><span class="line"><span class="keyword">elif</span> [ -x /usr/bin/awk ]; <span class="keyword">then</span></span><br><span class="line"> <span class="built_in">echo</span> awk is `/usr/bin/awk --version | <span class="built_in">head</span> -n1`</span><br><span class="line"><span class="keyword">else</span> </span><br><span class="line"> <span class="built_in">echo</span> <span class="string">&quot;awk not found&quot;</span> </span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line">gcc --version | <span class="built_in">head</span> -n1</span><br><span class="line">g++ --version | <span class="built_in">head</span> -n1</span><br><span class="line">ldd --version | <span class="built_in">head</span> -n1 | <span class="built_in">cut</span> -d<span class="string">&quot; &quot;</span> -f2- <span class="comment"># glibc version</span></span><br><span class="line">grep --version | <span class="built_in">head</span> -n1</span><br><span class="line">gzip --version | <span class="built_in">head</span> -n1</span><br><span class="line"><span class="built_in">cat</span> /proc/version</span><br><span class="line">m4 --version | <span class="built_in">head</span> -n1</span><br><span class="line">make --version | <span class="built_in">head</span> -n1</span><br><span class="line">patch --version | <span class="built_in">head</span> -n1</span><br><span class="line"><span class="built_in">echo</span> Perl `perl -V:version`</span><br><span class="line">python3 --version</span><br><span class="line">sed --version | <span class="built_in">head</span> -n1</span><br><span class="line">tar --version | <span class="built_in">head</span> -n1</span><br><span class="line">makeinfo --version | <span class="built_in">head</span> -n1 <span class="comment"># texinfo version</span></span><br><span class="line">xz --version | <span class="built_in">head</span> -n1</span><br><span class="line"><span class="built_in">echo</span> <span class="string">&#x27;int main()&#123;&#125;&#x27;</span> &gt; dummy.c &amp;&amp; g++ -o dummy dummy.c</span><br><span class="line"><span class="keyword">if</span> [ -x dummy ]</span><br><span class="line"> <span class="keyword">then</span> <span class="built_in">echo</span> <span class="string">&quot;g++ compilation OK&quot;</span>;</span><br><span class="line"> <span class="keyword">else</span> <span class="built_in">echo</span> <span class="string">&quot;g++ compilation failed&quot;</span>; <span class="keyword">fi</span></span><br><span class="line"><span class="built_in">rm</span> -f dummy.c dummy</span><br></pre></td></tr></table></div></figure>
<p>未通过：</p>
<figure class="highlight plaintext"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">bash, version 4.4.20(1)-release</span><br><span class="line">/bin/sh -&gt; /bin/dash</span><br><span class="line">ERROR: /bin/sh does not point to bash</span><br><span class="line">Binutils: (GNU Binutils for Ubuntu) 2.30</span><br><span class="line">./version-check.sh: line 10: bison: command not found</span><br><span class="line">yacc not found</span><br><span class="line">bzip2,  Version 1.0.6, 6-Sept-2010.</span><br><span class="line">Coreutils:  8.28</span><br><span class="line">diff (GNU diffutils) 3.6</span><br><span class="line">find (GNU findutils) 4.7.0-git</span><br><span class="line">./version-check.sh: line 22: gawk: command not found</span><br><span class="line">/usr/bin/awk -&gt; /usr/bin/mawk</span><br><span class="line">./version-check.sh: line 30: gcc: command not found</span><br><span class="line">./version-check.sh: line 31: g++: command not found</span><br><span class="line">(Ubuntu GLIBC 2.27-3ubuntu1.2) 2.27</span><br><span class="line">grep (GNU grep) 3.1</span><br><span class="line">gzip 1.6</span><br><span class="line">Linux version 5.4.0-42-generic (buildd@lgw01-amd64-023) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020</span><br><span class="line">./version-check.sh: line 36: m4: command not found</span><br><span class="line">./version-check.sh: line 37: make: command not found</span><br><span class="line">GNU patch 2.7.6</span><br><span class="line">Perl version=&#x27;5.26.1&#x27;;</span><br><span class="line">Python 3.6.9</span><br><span class="line">sed (GNU sed) 4.4</span><br><span class="line">tar (GNU tar) 1.29</span><br><span class="line">./version-check.sh: line 43: makeinfo: command not found</span><br><span class="line">xz (XZ Utils) 5.2.2</span><br><span class="line">./version-check.sh: line 45: g++: command not found</span><br><span class="line">g++ compilation failed</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>
<p>修复：</p>
<figure class="highlight sh"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">sudo <span class="built_in">ln</span> -sf /bin/bash /bin/sh</span><br><span class="line">sudo apt install bison</span><br><span class="line">sudo apt install gawk</span><br><span class="line">sudo apt install gcc</span><br><span class="line">sudo apt install g++</span><br><span class="line">sudo apt install make</span><br><span class="line">sudo apt install texinfo</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>
<p>通过</p>
<figure class="highlight plaintext"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">bash, version 4.4.20(1)-release</span><br><span class="line">/bin/sh -&gt; /bin/bash</span><br><span class="line">Binutils: (GNU Binutils for Ubuntu) 2.30</span><br><span class="line">bison (GNU Bison) 3.0.4</span><br><span class="line">/usr/bin/yacc -&gt; /usr/bin/bison.yacc</span><br><span class="line">bzip2,  Version 1.0.6, 6-Sept-2010.</span><br><span class="line">Coreutils:  8.28</span><br><span class="line">diff (GNU diffutils) 3.6</span><br><span class="line">find (GNU findutils) 4.7.0-git</span><br><span class="line">GNU Awk 4.1.4, API: 1.1 (GNU MPFR 4.0.1, GNU MP 6.1.2)</span><br><span class="line">/usr/bin/awk -&gt; /usr/bin/gawk</span><br><span class="line">gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0</span><br><span class="line">g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0</span><br><span class="line">(Ubuntu GLIBC 2.27-3ubuntu1.2) 2.27</span><br><span class="line">grep (GNU grep) 3.1</span><br><span class="line">gzip 1.6</span><br><span class="line">Linux version 5.4.0-42-generic (buildd@lgw01-amd64-023) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020</span><br><span class="line">m4 (GNU M4) 1.4.18</span><br><span class="line">GNU Make 4.1</span><br><span class="line">GNU patch 2.7.6</span><br><span class="line">Perl version=&#x27;5.26.1&#x27;;</span><br><span class="line">Python 3.6.9</span><br><span class="line">sed (GNU sed) 4.4</span><br><span class="line">tar (GNU tar) 1.29</span><br><span class="line">texi2any (GNU texinfo) 6.5</span><br><span class="line">xz (XZ Utils) 5.2.2</span><br><span class="line">g++ compilation OK</span><br></pre></td></tr></table></div></figure>

        <h3 id="创建新分区"   >
          <a href="#创建新分区" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#创建新分区"></a> 创建新分区</h3>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br></pre></td><td class="code"><pre><span class="line">root@ubuntu:/home/hippo# df /</span><br><span class="line">Filesystem     1K-blocks    Used Available Use% Mounted on</span><br><span class="line">/dev/sda1       20509264 7120976  12323432  37% /</span><br><span class="line">root@ubuntu:/home/hippo# fdisk /dev/sda</span><br><span class="line"></span><br><span class="line">Welcome to fdisk (util-linux 2.31.1).</span><br><span class="line">Changes will remain in memory only, until you decide to write them.</span><br><span class="line">Be careful before using the write command.</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">Command (m for help): n</span><br><span class="line">Partition type</span><br><span class="line">   p   primary (1 primary, 0 extended, 3 free)</span><br><span class="line">   e   extended (container for logical partitions)</span><br><span class="line">Select (default p): p</span><br><span class="line">Partition number (2-4, default 2): 2</span><br><span class="line">First sector (41940992-125829119, default 41940992): </span><br><span class="line">Last sector, +sectors or +size&#123;K,M,G,T,P&#125; (41940992-125829119, default 125829119): +4G</span><br><span class="line"></span><br><span class="line">Created a new partition 2 of type &#x27;Linux&#x27; and of size 4 GiB.</span><br><span class="line"></span><br><span class="line">Command (m for help): p</span><br><span class="line">Disk /dev/sda: 60 GiB, 64424509440 bytes, 125829120 sectors</span><br><span class="line">Units: sectors of 1 * 512 = 512 bytes</span><br><span class="line">Sector size (logical/physical): 512 bytes / 512 bytes</span><br><span class="line">I/O size (minimum/optimal): 512 bytes / 512 bytes</span><br><span class="line">Disklabel type: dos</span><br><span class="line">Disk identifier: 0xb792acfb</span><br><span class="line"></span><br><span class="line">Device     Boot    Start      End  Sectors Size Id Type</span><br><span class="line">/dev/sda1  *        2048 41940991 41938944  20G 83 Linux</span><br><span class="line">/dev/sda2       41940992 50329599  8388608   4G 83 Linux</span><br><span class="line"></span><br><span class="line">Command (m for help): F</span><br><span class="line">Unpartitioned space /dev/sda: 36 GiB, 38655754240 bytes, 75499520 sectors</span><br><span class="line">Units: sectors of 1 * 512 = 512 bytes</span><br><span class="line">Sector size (logical/physical): 512 bytes / 512 bytes</span><br><span class="line"></span><br><span class="line">   Start       End  Sectors Size</span><br><span class="line">50329600 125829119 75499520  36G</span><br><span class="line"></span><br><span class="line">Command (m for help): p</span><br><span class="line">Disk /dev/sda: 60 GiB, 64424509440 bytes, 125829120 sectors</span><br><span class="line">Units: sectors of 1 * 512 = 512 bytes</span><br><span class="line">Sector size (logical/physical): 512 bytes / 512 bytes</span><br><span class="line">I/O size (minimum/optimal): 512 bytes / 512 bytes</span><br><span class="line">Disklabel type: dos</span><br><span class="line">Disk identifier: 0xb792acfb</span><br><span class="line"></span><br><span class="line">Device     Boot    Start      End  Sectors Size Id Type</span><br><span class="line">/dev/sda1  *        2048 41940991 41938944  20G 83 Linux</span><br><span class="line">/dev/sda2       41940992 50329599  8388608   4G 83 Linux</span><br><span class="line"></span><br><span class="line">Command (m for help): n</span><br><span class="line">Partition type</span><br><span class="line">   p   primary (2 primary, 0 extended, 2 free)</span><br><span class="line">   e   extended (container for logical partitions)</span><br><span class="line">Select (default p): p</span><br><span class="line">Partition number (3,4, default 3): 3</span><br><span class="line">First sector (50329600-125829119, default 50329600): </span><br><span class="line">Last sector, +sectors or +size&#123;K,M,G,T,P&#125; (50329600-125829119, default 125829119): </span><br><span class="line"></span><br><span class="line">Created a new partition 3 of type &#x27;Linux&#x27; and of size 36 GiB.</span><br><span class="line"></span><br><span class="line">Command (m for help): p</span><br><span class="line">Disk /dev/sda: 60 GiB, 64424509440 bytes, 125829120 sectors</span><br><span class="line">Units: sectors of 1 * 512 = 512 bytes</span><br><span class="line">Sector size (logical/physical): 512 bytes / 512 bytes</span><br><span class="line">I/O size (minimum/optimal): 512 bytes / 512 bytes</span><br><span class="line">Disklabel type: dos</span><br><span class="line">Disk identifier: 0xb792acfb</span><br><span class="line"></span><br><span class="line">Device     Boot    Start       End  Sectors Size Id Type</span><br><span class="line">/dev/sda1  *        2048  41940991 41938944  20G 83 Linux</span><br><span class="line">/dev/sda2       41940992  50329599  8388608   4G 83 Linux</span><br><span class="line">/dev/sda3       50329600 125829119 75499520  36G 83 Linux</span><br><span class="line"></span><br><span class="line">Command (m for help): F</span><br><span class="line">Unpartitioned space /dev/sda: 0 B, 0 bytes, 0 sectors</span><br><span class="line">Units: sectors of 1 * 512 = 512 bytes</span><br><span class="line">Sector size (logical/physical): 512 bytes / 512 bytes</span><br><span class="line"></span><br><span class="line">Command (m for help): w</span><br><span class="line">The partition table has been altered.</span><br><span class="line">Syncing disks.</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">root@ubuntu:/home/hippo# partprobe</span><br><span class="line">root@ubuntu:/home/hippo# df /</span><br><span class="line">Filesystem     1K-blocks    Used Available Use% Mounted on</span><br><span class="line">/dev/sda1       20509264 6001700  13442708  31% /</span><br><span class="line">root@ubuntu:/home/hippo# mkfs -v -t ext4 /dev/sda3</span><br><span class="line">mke2fs 1.44.1 (24-Mar-2018)</span><br><span class="line">fs_types for mke2fs.conf resolution: &#x27;ext4&#x27;</span><br><span class="line">warning: 256 blocks unused.</span><br><span class="line"></span><br><span class="line">Filesystem label=</span><br><span class="line">OS type: Linux</span><br><span class="line">Block size=4096 (log=2)</span><br><span class="line">Fragment size=4096 (log=2)</span><br><span class="line">Stride=0 blocks, Stripe width=0 blocks</span><br><span class="line">2363904 inodes, 9437184 blocks</span><br><span class="line">471859 blocks (5.00%) reserved for the super user</span><br><span class="line">First data block=0</span><br><span class="line">Maximum filesystem blocks=2157969408</span><br><span class="line">288 block groups</span><br><span class="line">32768 blocks per group, 32768 fragments per group</span><br><span class="line">8208 inodes per group</span><br><span class="line">Filesystem UUID: 250b6088-b9c9-4c1f-94a3-5ba2394c44b0</span><br><span class="line">Superblock backups stored on blocks: </span><br><span class="line">	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, </span><br><span class="line">	4096000, 7962624</span><br><span class="line"></span><br><span class="line">Allocating group tables: done                            </span><br><span class="line">Writing inode tables: done                            </span><br><span class="line">Creating journal (65536 blocks): done</span><br><span class="line">Writing superblocks and filesystem accounting information: done   </span><br><span class="line"></span><br><span class="line">root@ubuntu:/home/hippo# export LFS=/mnt/lfs</span><br><span class="line">root@ubuntu:/home/hippo# mkdir -pv $LFS</span><br><span class="line">mkdir: created directory &#x27;/mnt/lfs&#x27;</span><br><span class="line">root@ubuntu:/home/hippo# mount -v -t ext4 /dev/sda3 $LFS</span><br><span class="line">mount: /dev/sda3 mounted on /mnt/lfs.</span><br><span class="line">root@ubuntu:/home/hippo# mkswap /dev/sda2</span><br><span class="line">Setting up swapspace version 1, size = 4 GiB (4294963200 bytes)</span><br><span class="line">no label, UUID=a77d57df-a150-4fd8-aaab-9f71945697f1</span><br><span class="line">root@ubuntu:/home/hippo# swapon /dev/sda2</span><br><span class="line">root@ubuntu:/home/hippo# mkdir -pv $LFS/sources</span><br><span class="line">mkdir: created directory &#x27;/mnt/lfs/sources&#x27;</span><br><span class="line">root@ubuntu:/home/hippo# chmod -v a+wt $LFS/sources</span><br><span class="line">mode of &#x27;/mnt/lfs/sources&#x27; changed from 0755 (rwxr-xr-x) to 1777 (rwxrwxrwt)</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h2 id="第3节-软件包和补丁"   >
          <a href="#第3节-软件包和补丁" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#第3节-软件包和补丁"></a> 第3节 软件包和补丁</h2>
      

        <h3 id="下载软件包"   >
          <a href="#下载软件包" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#下载软件包"></a> 下载软件包</h3>
      
<p>wget-list：</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br></pre></td><td class="code"><pre><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/acl-2.3.1.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/attr-2.5.1.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/autoconf-2.71.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/automake-1.16.4.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/bash-5.1.8.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/bc-5.0.0.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/binutils-2.37.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/bison-3.7.6.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/bzip2-1.0.8.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/check-0.15.2.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/coreutils-8.32.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/dbus-1.12.20.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/dejagnu-1.6.3.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/diffutils-3.8.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/e2fsprogs-1.46.4.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/elfutils-0.185.tar.bz2</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/eudev-3.2.10.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/expat-2.4.1.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/expect5.45.4.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/file-5.40.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/findutils-4.8.0.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/flex-2.6.4.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/gawk-5.1.0.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/gcc-11.2.0.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/gdbm-1.20.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/gettext-0.21.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/glibc-2.34.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/gmp-6.2.1.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/gperf-3.1.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/grep-3.7.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/groff-1.22.4.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/grub-2.06.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/gzip-1.10.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/iana-etc-20210611.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/inetutils-2.1.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/intltool-0.51.0.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/iproute2-5.13.0.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/Jinja2-3.0.1.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/kbd-2.4.0.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/kmod-29.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/less-590.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/lfs-bootscripts-20210608.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/libcap-2.53.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/libffi-3.4.2.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/libpipeline-1.5.3.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/libtool-2.4.6.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/linux-5.13.12.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/m4-1.4.19.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/make-4.3.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/man-db-2.9.4.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/man-pages-5.13.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/MarkupSafe-2.0.1.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/meson-0.59.1.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/mpc-1.2.1.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/mpfr-4.1.0.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/ncurses-6.2.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/ninja-1.10.2.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/openssl-1.1.1l.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/patch-2.7.6.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/perl-5.34.0.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/pkg-config-0.29.2.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/procps-ng-3.3.17.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/psmisc-23.4.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/Python-3.9.6.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/python-3.9.6-docs-html.tar.bz2</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/readline-8.1.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/sed-4.8.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/shadow-4.9.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/sysklogd-1.5.1.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/systemd-249.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/systemd-man-pages-249.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/sysvinit-2.99.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/tar-1.34.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/tcl8.6.11-src.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/tcl8.6.11-html.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/texinfo-6.8.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/tzdata2021a.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/udev-lfs-20171102.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/util-linux-2.37.2.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/vim-8.2.3337.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/XML-Parser-2.46.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/xz-5.2.5.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/zlib-1.2.11.tar.xz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/zstd-1.5.0.tar.gz</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/binutils-2.37-upstream_fix-1.patch</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/bzip2-1.0.8-install_docs-1.patch</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/coreutils-8.32-i18n-1.patch</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/glibc-2.34-fhs-1.patch</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/kbd-2.4.0-backspace-1.patch</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/perl-5.34.0-upstream_fixes-1.patch</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/sysvinit-2.99-consolidated-1.patch</span><br><span class="line">https://mirrors.ustc.edu.cn/lfs/lfs-packages/11.0/systemd-249-upstream_fixes-1.patch</span><br></pre></td></tr></table></div></figure>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">root@ubuntu:/home/hippo# </span><br><span class="line">wget --input-file=/home/hippo/wget-list --continue --directory-prefix=$LFS/sources</span><br></pre></td></tr></table></div></figure>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">root@ubuntu:/mnt/lfs/sources# </span><br><span class="line">wget --input-file=wget-list --continue --directory-prefix=$LFS/sources</span><br></pre></td></tr></table></div></figure>
<p>验证软件包完整性：</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash">md5sums</span></span><br><span class="line"></span><br><span class="line">95ce715fe09acca7c12d3306d0f076b2  acl-2.3.1.tar.xz</span><br><span class="line">ac1c5a7a084f0f83b8cace34211f64d8  attr-2.5.1.tar.gz</span><br><span class="line">12cfa1687ffa2606337efe1a64416106  autoconf-2.71.tar.xz</span><br><span class="line">86e8e682bd74e6390a016c4d9c11267c  automake-1.16.4.tar.xz</span><br><span class="line">23eee6195b47318b9fd878e590ccb38c  bash-5.1.8.tar.gz</span><br><span class="line">8345bb81c576ddfc8c27e0842370603c  bc-5.0.0.tar.xz</span><br><span class="line">e78d9ff2976b745a348f4c1f27c77cb1  binutils-2.37.tar.xz</span><br><span class="line">d61aa92e3562cb7292b004ce96173cf7  bison-3.7.6.tar.xz</span><br><span class="line">67e051268d0c475ea773822f7500d0e5  bzip2-1.0.8.tar.gz</span><br><span class="line">50fcafcecde5a380415b12e9c574e0b2  check-0.15.2.tar.gz</span><br><span class="line">022042695b7d5bcf1a93559a9735e668  coreutils-8.32.tar.xz</span><br><span class="line">68c5208c58236eba447d7d6d1326b821  dejagnu-1.6.3.tar.gz</span><br><span class="line">6a6b0fdc72acfe3f2829aab477876fbc  diffutils-3.8.tar.xz</span><br><span class="line">128f5b0f0746b28d1e3ca7e263c57094  e2fsprogs-1.46.4.tar.gz</span><br><span class="line">2b6e94c2eebc1f2194173e31bca9396e  elfutils-0.185.tar.bz2</span><br><span class="line">60b135a189523f333cea5f71a3345c8d  eudev-3.2.10.tar.gz</span><br><span class="line">a4fb91a9441bcaec576d4c4a56fa3aa6  expat-2.4.1.tar.xz</span><br><span class="line">00fce8de158422f5ccd2666512329bd2  expect5.45.4.tar.gz</span><br><span class="line">72540ea1cc8c6e1dee35d6100ec66589  file-5.40.tar.gz</span><br><span class="line">eeefe2e6380931a77dfa6d9350b43186  findutils-4.8.0.tar.xz</span><br><span class="line">2882e3179748cc9f9c23ec593d6adc8d  flex-2.6.4.tar.gz</span><br><span class="line">8470c34eeecc41c1aa0c5d89e630df50  gawk-5.1.0.tar.xz</span><br><span class="line">31c86f2ced76acac66992eeedce2fce2  gcc-11.2.0.tar.xz</span><br><span class="line">006c19b8b60828fd6916a16f3496bd3c  gdbm-1.20.tar.gz</span><br><span class="line">40996bbaf7d1356d3c22e33a8b255b31  gettext-0.21.tar.xz</span><br><span class="line">31998b53fb39cb946e96abc310af1c89  glibc-2.34.tar.xz</span><br><span class="line">0b82665c4a92fd2ade7440c13fcaa42b  gmp-6.2.1.tar.xz</span><br><span class="line">9e251c0a618ad0824b51117d5d9db87e  gperf-3.1.tar.gz</span><br><span class="line">7c9cca97fa18670a21e72638c3e1dabf  grep-3.7.tar.xz</span><br><span class="line">08fb04335e2f5e73f23ea4c3adbf0c5f  groff-1.22.4.tar.gz</span><br><span class="line">cf0fd928b1e5479c8108ee52cb114363  grub-2.06.tar.xz</span><br><span class="line">691b1221694c3394f1c537df4eee39d3  gzip-1.10.tar.xz</span><br><span class="line">f2854be57fe281e3ffc7364984467d2f  iana-etc-20210611.tar.gz</span><br><span class="line">4e7676d1980e57c7df665e5c5c3c1047  inetutils-2.1.tar.xz</span><br><span class="line">12e517cac2b57a0121cda351570f1e63  intltool-0.51.0.tar.gz</span><br><span class="line">15fc3786303a173a14e180afe4cd2ecd  iproute2-5.13.0.tar.xz</span><br><span class="line">3cac5be0096fcf7b32dcbd3c53831380  kbd-2.4.0.tar.xz</span><br><span class="line">e81e63acd80697d001c8d85c1acb38a0  kmod-29.tar.xz</span><br><span class="line">f029087448357812fba450091a1172ab  less-590.tar.gz</span><br><span class="line">6efd60044ad31a603a2c31c68919a988  lfs-bootscripts-20210608.tar.xz</span><br><span class="line">094994d4554c6689cf98ae4f717b8e19  libcap-2.53.tar.xz</span><br><span class="line">294b921e6cf9ab0fbaea4b639f8fdbe8  libffi-3.4.2.tar.gz</span><br><span class="line">dad443d0911cf9f0f1bd90a334bc9004  libpipeline-1.5.3.tar.gz</span><br><span class="line">1bfb9b923f2c1339b4d2ce1807064aa5  libtool-2.4.6.tar.xz</span><br><span class="line">6e1728b2021ca19cc9273f080e6c44c7  linux-5.13.12.tar.xz</span><br><span class="line">0d90823e1426f1da2fd872df0311298d  m4-1.4.19.tar.xz</span><br><span class="line">fc7a67ea86ace13195b0bce683fd4469  make-4.3.tar.gz</span><br><span class="line">6e233a555f7b9ae91ce7cd0faa322bce  man-db-2.9.4.tar.xz</span><br><span class="line">3ac24e8c6fae26b801cb87ceb63c0a30  man-pages-5.13.tar.xz</span><br><span class="line">9c8135ecde820094be2f42f457fb6535  meson-0.59.1.tar.gz</span><br><span class="line">9f16c976c25bb0f76b50be749cd7a3a8  mpc-1.2.1.tar.gz</span><br><span class="line">bdd3d5efba9c17da8d83a35ec552baef  mpfr-4.1.0.tar.xz</span><br><span class="line">e812da327b1c2214ac1aed440ea3ae8d  ncurses-6.2.tar.gz</span><br><span class="line">639f75bc2e3b19ab893eaf2c810d4eb4  ninja-1.10.2.tar.gz</span><br><span class="line">ac0d4387f3ba0ad741b0580dd45f6ff3  openssl-1.1.1l.tar.gz</span><br><span class="line">78ad9937e4caadcba1526ef1853730d5  patch-2.7.6.tar.xz</span><br><span class="line">df7ecb0653440b26dc951ad9dbfab517  perl-5.34.0.tar.xz</span><br><span class="line">f6e931e319531b736fadc017f470e68a  pkg-config-0.29.2.tar.gz</span><br><span class="line">d60613e88c2f442ebd462b5a75313d56  procps-ng-3.3.17.tar.xz</span><br><span class="line">8114cd4489b95308efe2509c3a406bbf  psmisc-23.4.tar.xz</span><br><span class="line">ecc29a7688f86e550d29dba2ee66cf80  Python-3.9.6.tar.xz</span><br><span class="line">0dae29e4c38af1b6b1a86b35c9e48923  python-3.9.6-docs-html.tar.bz2</span><br><span class="line">e9557dd5b1409f5d7b37ef717c64518e  readline-8.1.tar.gz</span><br><span class="line">6d906edfdb3202304059233f51f9a71d  sed-4.8.tar.xz</span><br><span class="line">126924090caf72f3de7e9261fd4e10ac  shadow-4.9.tar.xz</span><br><span class="line">c70599ab0d037fde724f7210c2c8d7f8  sysklogd-1.5.1.tar.gz</span><br><span class="line">6abc0ea61b8dd4a41b4e931a43b1bb90  sysvinit-2.99.tar.xz</span><br><span class="line">9a08d29a9ac4727130b5708347c0f5cf  tar-1.34.tar.xz</span><br><span class="line">8a4c004f48984a03a7747e9ba06e4da4  tcl8.6.11-src.tar.gz</span><br><span class="line">e358a9140c3a171e42f18c8a7f6a36ea  tcl8.6.11-html.tar.gz</span><br><span class="line">a91b404e30561a5df803e6eb3a53be71  texinfo-6.8.tar.xz</span><br><span class="line">20eae7d1da671c6eac56339c8df85bbd  tzdata2021a.tar.gz</span><br><span class="line">27cd82f9a61422e186b9d6759ddf1634  udev-lfs-20171102.tar.xz</span><br><span class="line">d659bf7cd417d93dc609872f6334b019  util-linux-2.37.2.tar.xz</span><br><span class="line">e0325a4988b1b99b9c2e46fa853c1980  vim-8.2.3337.tar.gz</span><br><span class="line">80bb18a8e6240fcf7ec2f7b57601c170  XML-Parser-2.46.tar.gz</span><br><span class="line">aa1621ec7013a19abab52a8aff04fe5b  xz-5.2.5.tar.xz</span><br><span class="line">85adef240c5f370b308da8c938951a68  zlib-1.2.11.tar.xz</span><br><span class="line">a6eb7fb1f2c21fa80030a47993853e92  zstd-1.5.0.tar.gz</span><br><span class="line">3518fa864fe8d7ef65be4960f380b03b  binutils-2.37-upstream_fix-1.patch</span><br><span class="line">6a5ac7e89b791aae556de0f745916f7f  bzip2-1.0.8-install_docs-1.patch</span><br><span class="line">cd8ebed2a67fff2e231026df91af6776  coreutils-8.32-i18n-1.patch</span><br><span class="line">9a5997c3452909b1769918c759eff8a2  glibc-2.34-fhs-1.patch</span><br><span class="line">f75cca16a38da6caa7d52151f7136895  kbd-2.4.0-backspace-1.patch</span><br><span class="line">fb42558b59ed95ee00eb9f1c1c9b8056  perl-5.34.0-upstream_fixes-1.patch</span><br><span class="line">4900322141d493e74020c9cf437b2cdc  sysvinit-2.99-consolidated-1.patch</span><br><span class="line"></span><br><span class="line">md5sum -c md5sums</span><br><span class="line"></span><br><span class="line">root@ubuntu:/mnt/lfs/sources# md5sum -c md5sums </span><br><span class="line">acl-2.3.1.tar.xz: OK</span><br><span class="line">attr-2.5.1.tar.gz: OK</span><br><span class="line">autoconf-2.71.tar.xz: OK</span><br><span class="line">automake-1.16.4.tar.xz: OK</span><br><span class="line">bash-5.1.8.tar.gz: OK</span><br><span class="line">bc-5.0.0.tar.xz: OK</span><br><span class="line">binutils-2.37.tar.xz: OK</span><br><span class="line">bison-3.7.6.tar.xz: OK</span><br><span class="line">bzip2-1.0.8.tar.gz: OK</span><br><span class="line">check-0.15.2.tar.gz: OK</span><br><span class="line">coreutils-8.32.tar.xz: OK</span><br><span class="line">dejagnu-1.6.3.tar.gz: OK</span><br><span class="line">diffutils-3.8.tar.xz: OK</span><br><span class="line">e2fsprogs-1.46.4.tar.gz: OK</span><br><span class="line">elfutils-0.185.tar.bz2: OK</span><br><span class="line">eudev-3.2.10.tar.gz: OK</span><br><span class="line">expat-2.4.1.tar.xz: OK</span><br><span class="line">expect5.45.4.tar.gz: OK</span><br><span class="line">file-5.40.tar.gz: OK</span><br><span class="line">findutils-4.8.0.tar.xz: OK</span><br><span class="line">flex-2.6.4.tar.gz: OK</span><br><span class="line">gawk-5.1.0.tar.xz: OK</span><br><span class="line">gcc-11.2.0.tar.xz: OK</span><br><span class="line">gdbm-1.20.tar.gz: OK</span><br><span class="line">gettext-0.21.tar.xz: OK</span><br><span class="line">glibc-2.34.tar.xz: OK</span><br><span class="line">gmp-6.2.1.tar.xz: OK</span><br><span class="line">gperf-3.1.tar.gz: OK</span><br><span class="line">grep-3.7.tar.xz: OK</span><br><span class="line">groff-1.22.4.tar.gz: OK</span><br><span class="line">grub-2.06.tar.xz: OK</span><br><span class="line">gzip-1.10.tar.xz: OK</span><br><span class="line">iana-etc-20210611.tar.gz: OK</span><br><span class="line">inetutils-2.1.tar.xz: OK</span><br><span class="line">intltool-0.51.0.tar.gz: OK</span><br><span class="line">iproute2-5.13.0.tar.xz: OK</span><br><span class="line">kbd-2.4.0.tar.xz: OK</span><br><span class="line">kmod-29.tar.xz: OK</span><br><span class="line">less-590.tar.gz: OK</span><br><span class="line">lfs-bootscripts-20210608.tar.xz: OK</span><br><span class="line">libcap-2.53.tar.xz: OK</span><br><span class="line">libffi-3.4.2.tar.gz: OK</span><br><span class="line">libpipeline-1.5.3.tar.gz: OK</span><br><span class="line">libtool-2.4.6.tar.xz: OK</span><br><span class="line">linux-5.13.12.tar.xz: OK</span><br><span class="line">m4-1.4.19.tar.xz: OK</span><br><span class="line">make-4.3.tar.gz: OK</span><br><span class="line">man-db-2.9.4.tar.xz: OK</span><br><span class="line">man-pages-5.13.tar.xz: OK</span><br><span class="line">meson-0.59.1.tar.gz: OK</span><br><span class="line">mpc-1.2.1.tar.gz: OK</span><br><span class="line">mpfr-4.1.0.tar.xz: OK</span><br><span class="line">ncurses-6.2.tar.gz: OK</span><br><span class="line">ninja-1.10.2.tar.gz: OK</span><br><span class="line">openssl-1.1.1l.tar.gz: OK</span><br><span class="line">patch-2.7.6.tar.xz: OK</span><br><span class="line">perl-5.34.0.tar.xz: OK</span><br><span class="line">pkg-config-0.29.2.tar.gz: OK</span><br><span class="line">procps-ng-3.3.17.tar.xz: OK</span><br><span class="line">psmisc-23.4.tar.xz: OK</span><br><span class="line">Python-3.9.6.tar.xz: OK</span><br><span class="line">python-3.9.6-docs-html.tar.bz2: OK</span><br><span class="line">readline-8.1.tar.gz: OK</span><br><span class="line">sed-4.8.tar.xz: OK</span><br><span class="line">shadow-4.9.tar.xz: OK</span><br><span class="line">sysklogd-1.5.1.tar.gz: OK</span><br><span class="line">sysvinit-2.99.tar.xz: OK</span><br><span class="line">tar-1.34.tar.xz: OK</span><br><span class="line">tcl8.6.11-src.tar.gz: OK</span><br><span class="line">tcl8.6.11-html.tar.gz: OK</span><br><span class="line">texinfo-6.8.tar.xz: OK</span><br><span class="line">tzdata2021a.tar.gz: OK</span><br><span class="line">udev-lfs-20171102.tar.xz: OK</span><br><span class="line">util-linux-2.37.2.tar.xz: OK</span><br><span class="line">vim-8.2.3337.tar.gz: OK</span><br><span class="line">XML-Parser-2.46.tar.gz: OK</span><br><span class="line">xz-5.2.5.tar.xz: OK</span><br><span class="line">zlib-1.2.11.tar.xz: OK</span><br><span class="line">zstd-1.5.0.tar.gz: OK</span><br><span class="line">binutils-2.37-upstream_fix-1.patch: OK</span><br><span class="line">bzip2-1.0.8-install_docs-1.patch: OK</span><br><span class="line">coreutils-8.32-i18n-1.patch: OK</span><br><span class="line">glibc-2.34-fhs-1.patch: OK</span><br><span class="line">kbd-2.4.0-backspace-1.patch: OK</span><br><span class="line">perl-5.34.0-upstream_fixes-1.patch: OK</span><br><span class="line">sysvinit-2.99-consolidated-1.patch: OK</span><br><span class="line">root@ubuntu:/mnt/lfs/sources# ls</span><br><span class="line">acl-2.3.1.tar.xz                    lfs-bootscripts-20210608.tar.xz</span><br><span class="line">attr-2.5.1.tar.gz                   libcap-2.53.tar.xz</span><br><span class="line">autoconf-2.71.tar.xz                libffi-3.4.2.tar.gz</span><br><span class="line">automake-1.16.4.tar.xz              libpipeline-1.5.3.tar.gz</span><br><span class="line">bash-5.1.8.tar.gz                   libtool-2.4.6.tar.xz</span><br><span class="line">bc-5.0.0.tar.xz                     linux-5.13.12.tar.xz</span><br><span class="line">binutils-2.37.tar.xz                m4-1.4.19.tar.xz</span><br><span class="line">binutils-2.37-upstream_fix-1.patch  make-4.3.tar.gz</span><br><span class="line">bison-3.7.6.tar.xz                  man-db-2.9.4.tar.xz</span><br><span class="line">bzip2-1.0.8-install_docs-1.patch    man-pages-5.13.tar.xz</span><br><span class="line">bzip2-1.0.8.tar.gz                  MarkupSafe-2.0.1.tar.gz</span><br><span class="line">check-0.15.2.tar.gz                 md5sums</span><br><span class="line">coreutils-8.32-i18n-1.patch         meson-0.59.1.tar.gz</span><br><span class="line">coreutils-8.32.tar.xz               mpc-1.2.1.tar.gz</span><br><span class="line">dbus-1.12.20.tar.gz                 mpfr-4.1.0.tar.xz</span><br><span class="line">dejagnu-1.6.3.tar.gz                ncurses-6.2.tar.gz</span><br><span class="line">diffutils-3.8.tar.xz                ninja-1.10.2.tar.gz</span><br><span class="line">e2fsprogs-1.46.4.tar.gz             openssl-1.1.1l.tar.gz</span><br><span class="line">elfutils-0.185.tar.bz2              patch-2.7.6.tar.xz</span><br><span class="line">eudev-3.2.10.tar.gz                 perl-5.34.0.tar.xz</span><br><span class="line">expat-2.4.1.tar.xz                  perl-5.34.0-upstream_fixes-1.patch</span><br><span class="line">expect5.45.4.tar.gz                 pkg-config-0.29.2.tar.gz</span><br><span class="line">file-5.40.tar.gz                    procps-ng-3.3.17.tar.xz</span><br><span class="line">findutils-4.8.0.tar.xz              psmisc-23.4.tar.xz</span><br><span class="line">flex-2.6.4.tar.gz                   python-3.9.6-docs-html.tar.bz2</span><br><span class="line">gawk-5.1.0.tar.xz                   Python-3.9.6.tar.xz</span><br><span class="line">gcc-11.2.0.tar.xz                   readline-8.1.tar.gz</span><br><span class="line">gdbm-1.20.tar.gz                    sed-4.8.tar.xz</span><br><span class="line">gettext-0.21.tar.xz                 shadow-4.9.tar.xz</span><br><span class="line">glibc-2.34-fhs-1.patch              sysklogd-1.5.1.tar.gz</span><br><span class="line">glibc-2.34.tar.xz                   systemd-249-upstream_fixes-1.patch</span><br><span class="line">gmp-6.2.1.tar.xz                    systemd-man-pages-249.tar.xz</span><br><span class="line">gperf-3.1.tar.gz                    sysvinit-2.99-consolidated-1.patch</span><br><span class="line">grep-3.7.tar.xz                     sysvinit-2.99.tar.xz</span><br><span class="line">groff-1.22.4.tar.gz                 tar-1.34.tar.xz</span><br><span class="line">grub-2.06.tar.xz                    tcl8.6.11-html.tar.gz</span><br><span class="line">gzip-1.10.tar.xz                    tcl8.6.11-src.tar.gz</span><br><span class="line">iana-etc-20210611.tar.gz            texinfo-6.8.tar.xz</span><br><span class="line">inetutils-2.1.tar.xz                tzdata2021a.tar.gz</span><br><span class="line">intltool-0.51.0.tar.gz              udev-lfs-20171102.tar.xz</span><br><span class="line">iproute2-5.13.0.tar.xz              util-linux-2.37.2.tar.xz</span><br><span class="line">Jinja2-3.0.1.tar.gz                 vim-8.2.3337.tar.gz</span><br><span class="line">kbd-2.4.0-backspace-1.patch         XML-Parser-2.46.tar.gz</span><br><span class="line">kbd-2.4.0.tar.xz                    xz-5.2.5.tar.xz</span><br><span class="line">kmod-29.tar.xz                      zlib-1.2.11.tar.xz</span><br><span class="line">less-590.tar.gz                     zstd-1.5.0.tar.gz</span><br><span class="line"></span><br></pre></td></tr></table></div></figure>

        <h2 id="第4节-最后的准备工作"   >
          <a href="#第4节-最后的准备工作" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#第4节-最后的准备工作"></a> 第4节 最后的准备工作</h2>
      
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br></pre></td><td class="code"><pre><span class="line">mkdir -pv $LFS/&#123;etc,var&#125; $LFS/usr/&#123;bin,lib,sbin&#125;</span><br><span class="line">for i in bin lib sbin; do</span><br><span class="line"> ln -sv usr/$i $LFS/$i</span><br><span class="line">done</span><br><span class="line">case $(uname -m) in</span><br><span class="line"> x86_64) mkdir -pv $LFS/lib64 ;;</span><br><span class="line">esac</span><br><span class="line"></span><br><span class="line">mkdir -pv $LFS/tools</span><br><span class="line"></span><br><span class="line">groupadd lfs</span><br><span class="line">useradd -s /bin/bash -g lfs -m -k /dev/null lfs</span><br><span class="line"></span><br><span class="line">passwd lfs</span><br><span class="line"></span><br><span class="line">chown -v lfs $LFS/&#123;usr&#123;,/*&#125;,lib,var,etc,bin,sbin,tools&#125;</span><br><span class="line">case $(uname -m) in</span><br><span class="line"> x86_64) chown -v lfs $LFS/lib64 ;;</span><br><span class="line">esac</span><br><span class="line"></span><br><span class="line">chown -v lfs $LFS/sources</span><br><span class="line"></span><br><span class="line">su - lfs</span><br><span class="line"></span><br><span class="line">cat &gt; ~/.bash_profile &lt;&lt; &quot;EOF&quot;</span><br><span class="line">exec env -i HOME=$HOME TERM=$TERM PS1=&#x27;\u:\w\$ &#x27; /bin/bash</span><br><span class="line">EOF</span><br><span class="line"></span><br><span class="line">cat &gt; ~/.bashrc &lt;&lt; &quot;EOF&quot;</span><br><span class="line">set +h</span><br><span class="line">umask 022</span><br><span class="line">LFS=/mnt/lfs</span><br><span class="line">LC_ALL=POSIX</span><br><span class="line">LFS_TGT=$(uname -m)-lfs-linux-gnu</span><br><span class="line">PATH=/usr/bin</span><br><span class="line">if [ ! -L /bin ]; then PATH=/bin:$PATH; fi</span><br><span class="line">PATH=$LFS/tools/bin:$PATH</span><br><span class="line">CONFIG_SITE=$LFS/usr/share/config.site</span><br><span class="line">export LFS LC_ALL LFS_TGT PATH CONFIG_SITE</span><br><span class="line">EOF</span><br><span class="line"></span><br><span class="line">source ~/.bash_profile</span><br></pre></td></tr></table></div></figure>

        <h3 id="重要"   >
          <a href="#重要" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#重要"></a> 重要</h3>
      
<blockquote>
<p>Important</p>
<p>The build instructions assume that the Host System Requirements, including symbolic links, have been set properly:</p>
<p>• bash is the shell in use.</p>
<p>• sh is a symbolic link to bash.</p>
<p>• /usr/bin/awk is a symbolic link to gawk.</p>
<p>• /usr/bin/yacc is a symbolic link to bison or a small script that executes bison.</p>

        <h4 id="重要-2"   >
          <a href="#重要-2" class="heading-link"><i class="fas fa-link"></i></a><a class="markdownIt-Anchor" href="#重要-2"></a> 重要</h4>
      
<p>编译指南假定你已经正确地设置了 <span class="exturl"><a class="exturl__link"   target="_blank" rel="noopener" href="https://lfs.xry111.site/zh_CN/11.2/chapter02/hostreqs.html" >宿主系统要求</a><span class="exturl__icon"><i class="fas fa-external-link-alt"></i></span></span> 和符号链接：</p>
<ul>
<li>shell 使用的是 <strong>bash</strong></li>
<li><strong>sh</strong> 是到 <strong>bash</strong> 的符号链接。</li>
<li><strong>/usr/bin/awk</strong> 是到 <strong>gawk</strong> 的符号链接。</li>
<li><strong>/usr/bin/yacc</strong> 是到 <strong>bison</strong> 的符号链接，或者是一个执行 bison 的小脚本。</li>
</ul>
</blockquote>
<blockquote>
<p>再次强调构建的过程：</p>
<ol>
<li>把所有源文件和补丁放到 chroot 环境可访问的目录，例如 <code>/mnt/lfs/sources/</code>。但是千万<em>不能</em>把源文件放在 <code>/mnt/lfs/tools/</code> 中。</li>
<li>进入到源文件目录。</li>
<li>对于每个软件包：</li>
<li>用 <strong>tar</strong> 程序解压要编译的软件包。在第五章中，<strong>确保解压软件包时你使用的是 <em>lfs</em> 用户</strong>。</li>
<li>进入到解压后创建的目录中。</li>
<li>根据指南说明编译软件包。</li>
<li>回退到源文件目录。</li>
<li>除非特别说明，删除解压出来的目录。</li>
</ol>
<p>Important</p>
<p>To re-emphasize the build process:</p>
<ol>
<li>
<p>Place all the sources and patches in a directory that will be accessible from the chroot environment such as /mnt/lfs/sources/.</p>
</li>
<li>
<p>Change to the sources directory.</p>
</li>
<li>
<p>For each package:</p>
</li>
</ol>
<p>a. Using the tar program, extract the package to be built. In Chapter 5 and Chapter 6, ensure you are the lfs user when extracting the package.</p>
<p>b. Change to the directory created when the package was extracted.</p>
<p>c. Follow the book’s instructions for building the package.</p>
<p>d. Change back to the sources ddirectory unless instructed otherwise</p>
</blockquote>
<p>问题：</p>
<p>软件包的所有者不是lfs，而是root。</p>
<blockquote>
<p>总结</p>
<p>(1) *.tar 用 tar –xvf 解压<br />
(2) *.gz 用 gzip -d或者gunzip 解压<br />
(3) <em>.tar.gz和</em>.tgz 用 tar –xzf 解压<br />
(4) *.bz2 用 bzip2 -d或者用bunzip2 解压<br />
(5) *.tar.bz2用tar –xjf 解压<br />
(6) *.Z 用 uncompress 解压<br />
(7) *.tar.Z 用tar –xZf 解压<br />
(8) *.rar 用 unrar e解压<br />
(9) *.zip 用 unzip 解压<br />
(10) *.xz 用 xz -d 解压<br />
(11) *.tar.xz 用 tar -zJf 解压 // 实测使用tar -xvf</p>
<p>大家可以注意到后面所有的解包命令均使用tar xvf来完成，而不管文件的压缩方式是bz2还是gz，这是因为较新的tar程序都具有自动识别后缀名并自动调用相应的解压缩工具的能力，所以可以不需要指定压缩方式，但对于早期的tar命令则可能不具备这个功能因此需要你根据包的压缩方式来指定，如bz2使用j，gz使用z，对应上面的binutils则是tar xvjf /lfs-sources/binutils-2.17.tar.bz2</p>
</blockquote>
<p>为lfs加入sudo权限：</p>
<figure class="highlight shell"><div class="table-container"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">su root //进入root用户</span><br><span class="line"></span><br><span class="line">vim /etc/sudoers //打开sudo的配置文件</span><br><span class="line"></span><br><span class="line">然后给普通用户kcc添加sudo权限，在“root ALL=(ALL)ALL”这一行下面，加入如下图所示的一行(用户名 ALL=(ALL) ALL)，并保存。</span><br><span class="line"></span><br><span class="line">然后强制修改 &#x27;:wq!&#x27;</span><br></pre></td></tr></table></div></figure></div><footer class="post-footer"><div class="post-ending ending"><div class="ending__text">------ 本文结束，感谢您的阅读 ------</div></div><div class="post-copyright copyright"><div class="copyright-author"><span class="copyright-author__name">本文作者: </span><span class="copyright-author__value"><a href="http://hipposox.github.io">HippoSoX</a></span></div><div class="copyright-link"><span class="copyright-link__name">本文链接: </span><span class="copyright-link__value"><a href="http://hipposox.github.io/2023/01/12/LFS-II-%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C/">http://hipposox.github.io/2023/01/12/LFS-II-%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C/</a></span></div><div class="copyright-notice"><span class="copyright-notice__name">版权声明: </span><span class="copyright-notice__value">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" rel="external nofollow" target="_blank">BY-NC-SA</a> 许可协议。转载请注明出处！</span></div></div><div class="post-tags"><span class="post-tags-item"><span class="post-tags-item__icon"><i class="fas fa-tag"></i></span><a class="post-tags-item__link" href="http://hipposox.github.io/tags/LFS/">LFS</a></span></div><nav class="post-paginator paginator"><div class="paginator-prev"><a class="paginator-prev__link" href="/2023/01/12/LFS-III-%E6%9E%84%E5%BB%BALFS%E4%BA%A4%E5%8F%89%E5%B7%A5%E5%85%B7%E9%93%BE%E5%92%8C%E4%B8%B4%E6%97%B6%E5%B7%A5%E5%85%B7/"><span class="paginator-prev__icon"><i class="fas fa-angle-left"></i></span><span class="paginator-prev__text">LFS-III-构建LFS交叉工具链和临时工具</span></a></div><div class="paginator-next"><a class="paginator-next__link" href="/2023/01/12/LFS-I-Introduction/"><span class="paginator-prev__text">LFS-I-Introduction</span><span class="paginator-next__icon"><i class="fas fa-angle-right"></i></span></a></div></nav></footer></div></div></div><div class="sidebar-wrap" id="sidebar-wrap"><aside class="sidebar" id="sidebar"><div class="sidebar-nav"><span class="sidebar-nav-toc current">文章目录</span><span class="sidebar-nav-ov">站点概览</span></div><section class="sidebar-toc"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#ii-%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C"><span class="toc-number">1.</span> <span class="toc-text">
           II 准备工作</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AC%AC2%E8%8A%82-%E5%87%86%E5%A4%87%E5%AE%BF%E4%B8%BB%E7%B3%BB%E7%BB%9F"><span class="toc-number">1.1.</span> <span class="toc-text">
           第2节 准备宿主系统</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%8D%A2%E6%BA%90"><span class="toc-number">1.1.1.</span> <span class="toc-text">
           换源</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%A3%80%E6%9F%A5%E7%BC%96%E8%AF%91%E7%8E%AF%E5%A2%83"><span class="toc-number">1.1.2.</span> <span class="toc-text">
           检查编译环境</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA%E6%96%B0%E5%88%86%E5%8C%BA"><span class="toc-number">1.1.3.</span> <span class="toc-text">
           创建新分区</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AC%AC3%E8%8A%82-%E8%BD%AF%E4%BB%B6%E5%8C%85%E5%92%8C%E8%A1%A5%E4%B8%81"><span class="toc-number">1.2.</span> <span class="toc-text">
           第3节 软件包和补丁</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%8B%E8%BD%BD%E8%BD%AF%E4%BB%B6%E5%8C%85"><span class="toc-number">1.2.1.</span> <span class="toc-text">
           下载软件包</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AC%AC4%E8%8A%82-%E6%9C%80%E5%90%8E%E7%9A%84%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C"><span class="toc-number">1.3.</span> <span class="toc-text">
           第4节 最后的准备工作</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%87%8D%E8%A6%81"><span class="toc-number">1.3.1.</span> <span class="toc-text">
           重要</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%87%8D%E8%A6%81-2"><span class="toc-number">1.3.1.1.</span> <span class="toc-text">
           重要</span></a></li></ol></li></ol></li></ol></li></ol></section><!-- ov = overview--><section class="sidebar-ov hide"><div class="sidebar-ov-author"><div class="sidebar-ov-author__avatar"><img class="sidebar-ov-author__avatar_img" src="/images/icons/stun-logo.svg" alt="avatar"></div><p class="sidebar-ov-author__text">motto</p></div><div class="sidebar-ov-state"><a class="sidebar-ov-state-item sidebar-ov-state-item--posts" href="/archives/"><div class="sidebar-ov-state-item__count">19</div><div class="sidebar-ov-state-item__name">归档</div></a><a class="sidebar-ov-state-item sidebar-ov-state-item--categories" href="/categories/"><div class="sidebar-ov-state-item__count">6</div><div class="sidebar-ov-state-item__name">分类</div></a><a class="sidebar-ov-state-item sidebar-ov-state-item--tags" href="/tags/"><div class="sidebar-ov-state-item__count">14</div><div class="sidebar-ov-state-item__name">标签</div></a></div><div class="sidebar-ov-cc"><a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en" target="_blank" rel="noopener" data-popover="知识共享许可协议" data-popover-pos="up"><img src="/images/cc-by-nc-sa.svg"></a></div></section><div class="sidebar-reading"><div class="sidebar-reading-info"><span class="sidebar-reading-info__text">你已阅读了 </span><span class="sidebar-reading-info__num">0</span><span class="sidebar-reading-info__perc">%</span></div><div class="sidebar-reading-line"></div></div><iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=1449790718&auto=1&height=66"></iframe></aside></div><div class="clearfix"></div></div></main><footer class="footer" id="footer"><div class="footer-inner"><div><span>Copyright © 2023</span><span class="footer__icon"><i class="fas fa-heart"></i></span><span>HippoSoX</span></div><div><span>由 <a href="http://hexo.io/" title="Hexo" target="_blank" rel="noopener">Hexo</a> 强力驱动</span><span> v5.4.2</span><span class="footer__devider">|</span><span>主题 - <a href="https://github.com/liuyib/hexo-theme-stun/" title="Stun" target="_blank" rel="noopener">Stun</a></span><span> v2.8.0</span></div></div></footer><div class="loading-bar" id="loading-bar"><div class="loading-bar__progress"></div></div><div class="back2top" id="back2top"><span class="back2top__icon"><i class="fas fa-rocket"></i></span></div></div><script src="https://cdn.jsdelivr.net/npm/jquery@v3.4.1/dist/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.min.js"></script><script src="https://cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.ui.min.js"></script><script src="https://cdn.jsdelivr.net/npm/lazyload@2.0.0-rc.2/lazyload.min.js"></script><script src="/js/utils.js?v=2.8.0"></script><script src="/js/stun-boot.js?v=2.8.0"></script><script src="/js/scroll.js?v=2.8.0"></script><script src="/js/header.js?v=2.8.0"></script><script src="/js/sidebar.js?v=2.8.0"></script></body></html>